// 自适应
function setRem() {
	let vW = window.innerWidth / 1920;
	let vH = window.innerHeight / 1080;
	document.getElementById('wrap').style.transform = "scale(" + vW + "," + vH + ")"
}
setRem();
window.onresize = function () {
	setRem()
};

// 判断日期是否改变
function isInitData(){
    let date=new Date()
    let day=date.getDate()
    let currentDay= localStorage.getItem('currentDay')
    if(currentDay!=day){     
        localStorage.setItem('currentDay',day)   
        return true;
    }else{        
        return false;
    }
}
// 判断小时
function hourChange(){
    let date=new Date()
    let hour=date.getHours()
    let currentHour= localStorage.getItem('currentHour')
    if(currentHour!=hour){     
        localStorage.setItem('currentHour',hour)   
        return true;
    }else{        
        return false;
    }
}

function generateRandomPhone() {
    // 中国手机号前三位/四位号段（覆盖主流运营商）
    const prefixes = [
      // 中国移动
      '134', '135', '136', '137', '138', '139', '147', '150', '151', '152', 
      '157', '158', '159', '178', '182', '183', '184', '187', '188', '198',
      // 中国联通
      '130', '131', '132', '145', '155', '156', '166', '171', '175', '176', 
      '185', '186',
      // 中国电信
      '133', '149', '153', '173', '177', '180', '181', '189', '199',
      // 虚拟运营商
      '170', '171', '162'
    ];
  
    // 随机选择号段
    const prefix = prefixes[Math.floor(Math.random() * prefixes.length)];
    
    // 生成后四位随机数字
    const suffix = String(Math.floor(Math.random() * 10000)).padStart(4, '0');
    
    // 组合成完整号码（格式：XXX****XXXX）
    return `${prefix}****${suffix}`;
  }
  
  // 示例输出：189****8852 / 170****1234
  
function generateRandomTime(startTimeStr = '00:00:00', endTimeStr = '23:59:59') {
    // 获取今天日期（时间部分归零）
    const today = new Date();
    today.setHours(0, 0, 0, 0);
  
    // 解析开始和结束时间（支持格式: "HH:mm" 或 "HH:mm:ss"）
    const parseTime = (timeStr) => {
      const [hours, minutes, seconds = 0] = timeStr.split(':').map(Number);
      const time = new Date(today);
      time.setHours(hours, minutes, seconds);
      return time;
    };
  
    const startTime = parseTime(startTimeStr);
    const endTime = parseTime(endTimeStr);
  
    // 处理跨天或反向时间（自动交换）
    if (startTime > endTime) [startTime, endTime] = [endTime, startTime];
  
    // 生成随机时间戳
    const randomTimestamp = startTime.getTime() + Math.random() * (endTime.getTime() - startTime.getTime());
    const randomDate = new Date(randomTimestamp);
  
    // 格式化日期（月份、日期不加前导零，时分秒补零）
    const year = randomDate.getFullYear();
    const month = randomDate.getMonth() + 1;
    const day = randomDate.getDate();
    const hours = String(randomDate.getHours()).padStart(2, '0');
    const minutes = String(randomDate.getMinutes()).padStart(2, '0');
    const seconds = String(randomDate.getSeconds()).padStart(2, '0');
  
    return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  }
  
 function getPost(){
    const postArr=['生活服务','酒店','酒吧','商场','医院','车站','休闲','茶饮','服务','会所','娱乐','景区','美容美发','餐饮']
    const post = postArr[Math.floor(Math.random() * postArr.length)];
    return post;
}

function generateProvincialCapitalAddress() {
    // 34个省级行政区（23个省会 + 5个自治区首府 + 4个直辖市 + 2个特别行政区）
    const cityDistrictMap = {
      // 23个省会
      '石家庄市': ['长安区', '桥西区', '新华区', '裕华区'],
      '太原市': ['杏花岭区', '小店区', '迎泽区', '尖草坪区'],
      '沈阳市': ['和平区', '沈河区', '大东区', '皇姑区'],
      '长春市': ['朝阳区', '南关区', '宽城区', '二道区'],
      '哈尔滨市': ['道里区', '南岗区', '道外区', '香坊区'],
      '南京市': ['玄武区', '秦淮区', '建邺区', '鼓楼区'],
      '杭州市': ['上城区', '拱墅区', '西湖区', '滨江区'],
      '合肥市': ['庐阳区', '蜀山区', '包河区', '瑶海区'],
      '福州市': ['鼓楼区', '台江区', '仓山区', '晋安区'],
      '南昌市': ['东湖区', '西湖区', '青云谱区', '青山湖区'],
      '济南市': ['历下区', '市中区', '槐荫区', '天桥区'],
      '郑州市': ['中原区', '二七区', '金水区', '惠济区'],
      '武汉市': ['江岸区', '江汉区', '硚口区', '汉阳区'],
      '长沙市': ['芙蓉区', '天心区', '岳麓区', '开福区'],
      '广州市': ['天河区', '越秀区', '海珠区', '荔湾区'],
      '海口市': ['秀英区', '龙华区', '琼山区', '美兰区'],
      '成都市': ['锦江区', '青羊区', '金牛区', '武侯区'],
      '贵阳市': ['南明区', '云岩区', '花溪区', '乌当区'],
      '昆明市': ['五华区', '盘龙区', '官渡区', '西山区'],
      '西安市': ['新城区', '碑林区', '莲湖区', '雁塔区'],
      '兰州市': ['城关区', '七里河区', '西固区', '安宁区'],
      '西宁市': ['城东区', '城中区', '城西区', '城北区'],
      // 5个自治区首府
      '呼和浩特市': ['新城区', '回民区', '玉泉区', '赛罕区'],
      '南宁市': ['青秀区', '兴宁区', '西乡塘区', '江南区'],
      '拉萨市': ['城关区', '堆龙德庆区', '达孜区', '当雄县'],
      '银川市': ['兴庆区', '西夏区', '金凤区', '永宁县'],
      '乌鲁木齐市': ['天山区', '沙依巴克区', '新市区', '水磨沟区'],
      // 4个直辖市
      '北京市': ['朝阳区', '海淀区', '东城区', '西城区'],
      '天津市': ['和平区', '河东区', '河西区', '南开区'],
      '上海市': ['黄浦区', '徐汇区', '长宁区', '静安区'],
      '重庆市': ['渝中区', '大渡口区', '江北区', '沙坪坝区'],
    };
  
    // 随机路名组件（扩展版）
    const roadPrefix = ['中山', '人民', '解放', '建设', '和平', '新华', '朝阳', '银杏', '芙蓉', '长江', '黄河', '昆仑'];
    const roadSuffix = ['路', '街', '大道', '巷', '北路', '南路', '东路', '西路'];
  
    // 随机生成地址
    const cities = Object.keys(cityDistrictMap);
    const city = cities[Math.floor(Math.random() * cities.length)];
    const district = cityDistrictMap[city][Math.floor(Math.random() * cityDistrictMap[city].length)];
    const road = roadPrefix[Math.floor(Math.random() * roadPrefix.length)] + 
                 roadSuffix[Math.floor(Math.random() * roadSuffix.length)];
    const number = Math.floor(Math.random() * 999) + 1;
  
    return `${city}${district}${road}${number}号`;
  }
  
  // 示例输出：合肥市庐阳区黄河西路123号 / 香港特别行政区湾仔区解放大道456号
  function formatDate(format) {
    var date=new Date();
    let time = {
       'M+': date. getMonth()+1,  
       'd+': date.getDate(),  
       'h+': date. getHours(),  
       'm+': date. getMinutes()-1,  
       's+': date. getSeconds (),
       'q+': Math. floor((date. getMonth()+ 3)/ 3),  
       'S+': date. getMilliseconds() 
   }
   if(/(y+)/i.test(format)){  
       format =format.replace(RegExp.$1, (date.getFullYear() +'').substr(4-RegExp.$1.length));  
   }
   for (let k in time){  
       if (new RegExp('('+ k +')' ).test(format)){ 
           format =format.replace(RegExp.$1, RegExp.$1.length === 1 ? time[k]: ('00'+ time[k]).substr(('' + time[k]).length));
       }
   }
   return format;
}

// 地图
function loadMap(res, dom) { 
    var myChart = echarts.init(document.getElementById(dom));

    // $.getJSON('js/data.json', function (geoCoordMap) {

        //数据部分
        var data = res
        var convertData = function(data) {
            var res = [];
            for (var i = 0; i < data.length; i++) {
                var geoCoord= geoCoordMap.features.filter(item=>item.properties.name==data[i].name)
                if (geoCoord) {
                    res.push({
                        name: data[i].name,
                        value: geoCoord[0].properties.cp.concat(data[i].value)
                    });
                }
            }
            res.push({name:'深圳',value:['114.0578','22.5369',100]})
            return res;
        };
        
        
        echarts.registerMap('china', geoCoordMap);
        let option = {
                tooltip: {
                    trigger: 'item',
                    // position: 'unset',
                    backgroundColor: 'rgba(0,0,0,0)',
                    formatter: function(params) {
                        return params.name;
                        var tip = '';
                        if (params.componentSubType === 'effectScatter') {
                            tip = `<div style="background:#000259;height:28px;line-height:28px;padding: 0 9px;fontSize:18px">
                                    ${params.name}:${params.value[2]}人
                                </div>`;
                            return tip;
                        } else {
                            if(params.componentSubType === 'map'){if(params.value){
                            tip = `<div style="display:flex;background:none;position:relative;top:-50px;left:-20px">
                                    <div style="height:44px;width:1px;background:#00FFF6">1</div>
                                    <div style="background:#000259;height:28px;line-height:28px;padding: 0 9px;fontSize:18px">
                                    ${params.name}:${params.value}人</div>
                                </div>`
                            }}
                        }
                        return tip;
                    }
                },
                geo: 
                    {
                        type: 'map',
                        map: 'china',
                        zlevel: -5,
                        zoom: 1.2,
                        top:60,
                    // layoutSize: '90%',
                        roam: false,
                        silent: true,
                        itemStyle: {
                            normal: {
                                borderColor: '#ffffff',
                                borderWidth: 3,
                                shadowColor: '#ffffff',
                                // shadowColor:'red',
                                shadowColor: '#00F6FF',
                                // shadowColor:'red',
                                shadowBlur: 15,
                            }
                        }
                    },
            series: [
                {
                    type: 'map',
                    map: 'china',
                    zlevel: 5,
                    geoIndex: 1,
                    data: data,
                    zoom: 1.2,
                    top:60,
                    aspectScale: 0.75, //长宽比
                    showLegendSymbol: true, // 存在legend时显示
                    label: {
                        normal: {
                            show: true,
                            textStyle: {
                                color: '#fff'
                            }
                        },
                        emphasis: {
                            show: false,
                            textStyle: {
                                color: '#fff'
                            }
                        }
                    },
                    roam: false,
                    itemStyle: {
                        
                        normal: {
                            borderColor: 'rgba(111, 253, 255, 1)',
                            borderWidth: 0.5,
                            // areaColor: 'rgba(29,85,139,.6)'
                            areaColor: {
                                    type: 'linear-gradient',
                                    x: 0,
                                    y: 600,
                                    x2: 0,
                                    y2: 0,
                                    colorStops: [{
                                        offset: 0,
                                        color: 'RGBA(37,108,190,1)' // 0% 处的颜色
                                    }, {
                                        offset: 1,
                                        color: 'RGBA(15,169,195,1)' // 50% 处的颜色
                                    }],
                                    global: true // 缺省为 false
                                },
                        },
                        emphasis: {
                            areaColor: {
                                    type: 'linear-gradient',
                                    x: 0,
                                    y: 600,
                                    x2: 0,
                                    y2: 0,
                                    colorStops: [{
                                        offset: 0,
                                        color: 'RGBA(37,108,190,1)' // 0% 处的颜色
                                    }, {
                                        offset: 1,
                                        color: 'RGBA(15,169,195,1)' // 50% 处的颜色
                                    }],
                                    global: true // 缺省为 false
                                },
                        }
                    },
                },
                {
                    type: 'effectScatter',
                    coordinateSystem: 'geo',
                    geoIndex: 0,
                    symbol: 'circle',
                    symbolSize: 6,
                    showEffectOn: 'render',
                    rippleEffect: {
                        brushType: 'stroke',
                        scale: 10
                    },
                    hoverAnimation: true,
                    label: {
                        show: false,
                        formatter: name => {
                            return name.data[2];
                        },
                        position: 'right',
                        color: '#fff',
                        fontSize: 14,
                        distance: 10
                    },
                    itemStyle: {
                        color: 'rgba(0, 255, 246, 1)',
                    },
                    zlevel: 12,
                    data: convertData(data)
                }, {
                    type: 'effectScatter',
                    coordinateSystem: 'geo',
                    geoIndex: 0,
                    silent: true,
                    symbol: 'circle',
                    symbolSize: 4,
                    showEffectOn: 'render',
                    rippleEffect: {
                        brushType: 'stroke',
                        scale: 6
                    },
                    hoverAnimation: true,
                    label: {
                        formatter: '',
                        position: 'right',
                        color: '#fff',
                        fontSize: 14,
                        distance: 10,
                        show: !0,
                    },
                    itemStyle: {
                        color: 'rgba(255, 255, 255, 0.8)',
                    },
                    zlevel: 6,
                    data: convertData(data)
                }
            ]
        };
        myChart.clear(option);
        myChart.setOption(option);               
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    // })
    
}

function bar1(res, dom){
    var myChart = echarts.init(document.getElementById(dom));
    let {xData,yData}=res
   let option = {
        grid: {
            top: '25%',
            left: '5%',
            bottom: '5%',
            right: '5%',
            containLabel: true,
        },
        tooltip: {
            trigger:'item'
        },
        animation: false,
        xAxis: [
            {
                data: xData,               
                axisTick: {
                    show:false
                },
                axisLabel: {
                    // interval:0,
                    textStyle: {
                        color: '#B0E5FF',
                        fontSize:14
                    },
                    margin: 10,
                },
                axisLine: {
                    show: true,
                    lineStyle: {
                         color:'rgba(37, 101, 230, 0.5)'
                    },
                },
            },
        ],
        yAxis: [
            {
                type: 'value',
                name:'单位（单）',
                axisLabel: {
                    textStyle: {
                        color: '#B0E5FF',
                        fontSize:14
                    },
                },
                nameTextStyle: {
                    color: '#B0E5FF',
                    fontSize:16
                },
                axisTick: {
                    show:false
                },
                splitLine: {
                    lineStyle: {
                        color: 'rgba(48, 117, 255, 0.3)',
                        type:'dashed'
                    },
                },
                axisLine: {
                    show: true,
                    lineStyle: {
                        color:'rgba(37, 101, 230, 0.5)'
                    },
                },
            },
        ],
        series: [
            {
                name: '',
                type: 'pictorialBar',
                symbolSize: [15, 5],
                symbolOffset: [0, -4], // 上部椭圆
                symbolPosition: 'end',
                z: 12,
                label: {
                    normal: {
                        show: false,
                    },
                },
                color: '#B2FFFF',
                data: yData,
            },
            {
                type: 'bar',
                //silent: true,
                barWidth: '15',
                barGap: '10%', // Make series be overlap
                barCateGoryGap: '10%',
                itemStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                            {
                                offset: 0,
                                color: 'rgba(0, 255, 255, 1)',
                            },
                            {
                                offset: 1,
                                color: 'rgba(0, 255, 255, 0)',
                            },
                        ]),
                        opacity: 0.8,
                    },
                },
                data: yData,
            },
        ],
    };
    
    myChart.clear(option);
    myChart.setOption(option);               
    window.addEventListener("resize", function () {
        myChart.resize();
    });
}

function bar2(res, dom){
    var myChart = echarts.init(document.getElementById(dom));
    const CubeLeft = echarts.graphic.extendShape({
        shape: {
            x: 0,
            y: 0,
        },
        buildPath: function (ctx, shape) {
            const yAxisPoint = shape.yAxisPoint;
            const c0 = [shape.x, shape.y];
            const c1 = [shape.x + 6, shape.y - 6];
            const c2 = [yAxisPoint[0] + 6, yAxisPoint[1] - 6];
            const c3 = [yAxisPoint[0], yAxisPoint[1]];
            ctx.moveTo(c0[0], c0[1])
                .lineTo(c1[0], c1[1])
                .lineTo(c2[0], c2[1])
                .lineTo(c3[0], c3[1])
                .closePath();
        },
    });
    const CubeRight = echarts.graphic.extendShape({
        shape: {
            x: 0,
            y: 0,
        },
        buildPath: function (ctx, shape) {
            const yAxisPoint = shape.yAxisPoint;
            const c1 = [shape.x, shape.y];
            const c2 = [yAxisPoint[0], yAxisPoint[1]];
            const c3 = [yAxisPoint[0] + 6, yAxisPoint[1] + 12];
            const c4 = [shape.x + 6, shape.y + 12];
            ctx.moveTo(c1[0], c1[1])
                .lineTo(c2[0], c2[1])
                .lineTo(c3[0], c3[1])
                .lineTo(c4[0], c4[1])
                .closePath();
        },
    });
    const CubeTop = echarts.graphic.extendShape({
        shape: {
            x: 0,
            y: 0,
        },
        buildPath: function (ctx, shape) {
            const c1 = [shape.x, shape.y];
            const c2 = [shape.x + 6, shape.y + 12];
            const c3 = [shape.x + 12, shape.y + 6];
            const c4 = [shape.x + 6, shape.y - 6];
            ctx.moveTo(c1[0], c1[1])
                .lineTo(c2[0], c2[1])
                .lineTo(c3[0], c3[1])
                .lineTo(c4[0], c4[1])
                .closePath();
        },
    });
    // const CubeLeft = echarts.graphic.extendShape({
    //     shape: {
    //         x: 0,
    //         y: 0
    //     },
    //     buildPath: function(ctx, shape) {
    //         const xAxisPoint = shape.xAxisPoint
    //         const c0 = [shape.x, shape.y]
    //         const c1 = [shape.x - 6, shape.y - 6]
    //         const c2 = [xAxisPoint[0] - 6, xAxisPoint[1] - 6]
    //         const c3 = [xAxisPoint[0], xAxisPoint[1]]
    //         ctx.moveTo(c0[0], c0[1]).lineTo(10[1], c1[0]).lineTo(c2[1], c2[0]).lineTo(c3[1], c3[0]).closePath()
    //     }
    // })
    // const CubeRight = echarts.graphic.extendShape({
    //     shape: {
    //         x: 0,
    //         y: 0
    //     },
    //     buildPath: function(ctx, shape) {
    //         // const xAxisPoint = shape.xAxisPoint
    //         // const c1 = [shape.x, shape.y]
    //         // const c2 = [xAxisPoint[0], xAxisPoint[1]]
    //         // const c3 = [xAxisPoint[0] + 12, xAxisPoint[1] - 6]
    //         // const c4 = [shape.x + 12, shape.y - 6]
    //         // ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]).closePath()
    //         const c1 = [shape.x, shape.y]
    //         const c2 = [shape.x-6, shape.y +12]
    //         const c3 = [shape.x - 12, shape.y +6]
    //         const c4 = [shape.x- 6, shape.y - 6]
    //         ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]).closePath()
    //     }
    // })
    // const CubeTop = echarts.graphic.extendShape({
    //     shape: {
    //         x: 0,
    //         y: 0
    //     },
    //     buildPath: function(ctx, shape) {
    //         const c1 = [shape.x, shape.y]
    //         const c2 = [shape.x + 12, shape.y - 6]
    //         const c3 = [shape.x + 6, shape.y - 12]
    //         const c4 = [shape.x- 6, shape.y - 6]
    //         ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]).closePath()
         
    //     }
    // })
    echarts.graphic.registerShape('CubeLeft', CubeLeft)
    echarts.graphic.registerShape('CubeRight', CubeRight)
    echarts.graphic.registerShape('CubeTop', CubeTop)
    let {xData,yData}=res
    let option = {
        tooltip:{
          trigger:'axis' ,
          formatter:(data,a)=>{
            return data[0].value+'亿';
          } 
        },
        grid: {
            left: 20,
            right: 20,
            bottom: 10,
            top: 50,
            containLabel: true
        },
        yAxis: {
            type: 'category',
            data:xData,
            name:'单位（亿人）',
            nameTextStyle: {
                color: '#B0E5FF',
                fontSize:16,                
            },
            axisLine: {
                show: true,
                lineStyle: {
                    color:'rgba(37, 101, 230, 0.5)'
                }
            },
            axisTick: {
                show: false,
            },
            splitLine: {
                show: false,
                lineStyle:{
                    color:'rgba(48, 117, 255, 0.3)',
                    type:'dashed'
                }
            },
            axisLabel: {
                interval:0,
                color:'#B0E5FF',
                fontSize: 14
            }
        },
        xAxis: {
            type: 'value',
            
            axisLine: {
                show: true,
                lineStyle: {
                     color:'rgba(37, 101, 230, 0.5)'
                }
            },
            splitLine: {
                show: true,
                lineStyle:{
                    color:'rgba(48, 117, 255, 0.3)',
                    type:'dashed'
                }
            },
            axisTick: {
                show: false
            },
            axisLabel: {
                color:'#B0E5FF',
                fontSize: 14
            },
        },
        series: [{
            type: 'custom',
            renderItem: (params, api) => {
                const location = api.coord([api.value(0), api.value(1)])
                return {
                    type: 'group',
                    children: [{
                        type: 'CubeLeft',
                        shape: {
                            api,
                            xValue: api.value(0),
                            yValue: api.value(1),
                            x: location[0],
                            y: location[1],
                            yAxisPoint: api.coord([0,api.value(1)])
                        },
                        style: {
                            fill: params.dataIndex%2==0?new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
                                    offset: 0,
                                    color: 'rgba(0, 120, 194, 1)'
                                },
                                {
                                    offset: 1,
                                    color: 'rgba(0, 120, 194, 0)'
                                }
                            ]):new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
                                offset: 0,
                                color: 'rgba(0, 194, 128, 1)'
                            },
                            {
                                offset: 1,
                                color: 'rgba(0, 194, 128,0)'
                            }
                        ])
                        }
                    }, 
                    {
                        type: 'CubeRight',
                        shape: {
                            api,
                            xValue: api.value(0),
                            yValue: api.value(1),
                            x: location[0],
                            y: location[1],
                            yAxisPoint: api.coord([0,api.value(1)])
                        },
                        style: {
                            fill:  params.dataIndex%2==0?new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
                                    offset: 0,
                                    color: 'rgba(36, 148, 217, 1)'
                                },
                                {
                                    offset: 1,
                                    color: 'rgba(36, 148, 217, 0)'
                                }
                            ]):new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
                                offset: 0,
                                color: 'rgba(78, 213, 173, 1)'
                            },
                            {
                                offset: 1,
                                color: 'rgba(78, 213, 173, 0)'
                            }
                        ])
                        }
                    }, {
                        type: 'CubeTop',
                        shape: {
                            api,
                            xValue: api.value(0),
                            yValue: api.value(1),
                            x: location[0],
                            y: location[1],
                            yAxisPoint: api.coord([0,api.value(1)])
                        },
                        style: {
                            fill: params.dataIndex%2==0?'rgba(57, 198, 250, 1)':'rgba(44, 212, 174, 1)'
                        }
                    }
                ]
                }
            },
            data: yData
        },]
    }
    
    myChart.clear(option);
    myChart.setOption(option);               
    window.addEventListener("resize", function () {
        myChart.resize();
    });
}

function line(res,dom){
    var myChart = echarts.init(document.getElementById(dom));
    let {xData,yData}=res
    option = {
        tooltip: {
            trigger:'axis'  
        },
        grid: {
            top: 50,
            left: 20,
            right: 30,
            bottom: 15,
            containLabel: true,
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: xData,
            axisLabel: {
                margin:15,
                color: '#B0E5FF',
                fontSize:14,
                interval:0,
            },
            axisLine: {
                show: true,
                lineStyle:{
                    color:'rgba(37, 101, 230, 0.5)'
                }
            },
            axisTick: {
                show: false,
            },
            splitLine: {
                show: false,
            }
        },
        yAxis: [{
            type: 'value',
            name:'单位（人）',
            nameTextStyle: {
                color: '#B0E5FF',
                fontSize:16
            },
            axisLabel: {
                color: '#B0E5FF',
                fontSize:14
            },
    
            axisTick: {
                show: false,
            },
            splitLine: {
                show: true,
                lineStyle: {
                    color: 'rgba(48, 117, 255, 0.3)',
                    type:'dashed'
                }
            },
            axisLine: {
                lineStyle:{
                    color:'rgba(37, 101, 230, 0.5)'
                }
            }
        }],
        series: [{
            type: 'line',
            smooth: true, //是否平滑曲线显示
            showAllSymbol: true,
            symbol: 'circle',
            symbolSize: 8,
            lineStyle: {
                normal: {
                    color: "#07C7FF", // 线条颜色
                },
            },
            label: {
                show: true,
                position: 'top',
                textStyle: {
                    color: '#F5FCFF',
                    fontSize:14
                }
            },
            itemStyle: {
                color: "#07C7FF",
                borderColor: "#fff",
                borderWidth: 1
            },           
            areaStyle: {
                normal: {
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(7, 199, 255, 1)'
                        },
                        {
                            offset: 1,
                            color: 'rgba(7, 199, 255, 0)'
                        }
                    ], false),
                }
            },
            data: yData
        }]
    };

    myChart.clear(option);
    myChart.setOption(option);               
    window.addEventListener("resize", function () {
        myChart.resize();
    });
}

function render1(list){
    $('.scroll2').html('')
    clearInterval(timer2)
    list.forEach((item ,index)=> {
        $('.scroll2').append(`
        <li class="item">
            <div class="num num${index+1}">${('0'+(index+1)).slice(-2)}</div>
            <div class="t1">
                <p class="img"><img src="${item.img}"></p>
                <p class="txt">${item.tel}</p>
            </div>
            <div class="t2 w98">
                <p>今日收入</p>
                <p><span>¥</span>${item.today}</p>
            </div>
            <div class="t2 w110">
                <p>昨日收入</p>
                <p>${item.yesterday}</p>
            </div>
            <div class="t2 w110">
                <p>合作设备数量</p>
                <p>${item.tomorrow}</p>
            </div>
        </li>`)
    });
    var timer2= setInterval(function() {
        YU.topScroll(".scroll2",2000);
    },3000);
}
function render2(list){
    $('.scroll1').html('')
    clearInterval(timer)
    list.forEach((item ,index)=> {
        $('.scroll1').append(`
       <li class="item">
            <span class="s0">${item.time}</span>
            <span class="s1">${item.address}</span>
            <span class="s2">¥${item.caches}</span>
            <span class="s2">${item.post}</span>
        </li>`)
    });
    var timer= setInterval(function() {
		YU.topScroll(".scroll1",2000);
	},3000);
}
function render3(data){
    $('.priceList').html(`
        <div class="item">
            <img src="img/pic1.png" alt="">
            <div class="txt">
                <p class="num">${data.today} <span>元</span></p>
                <p class="tit">今日实时收入</p>
            </div>
        </div>
        <div class="item">
            <img src="img/pic2.png" alt="">
            <div class="txt">
                <p class="num">${data.yesterday} <span>元</span></p>
                <p class="tit">昨日总收入</p>
            </div>
        </div>
        <div class="item">
            <img src="img/pic3.png" alt="">
            <div class="txt">
                <p class="num">${data.price} <span>元</span></p>
                <p class="tit">单均价格</p>
            </div>
        </div>
        <div class="item">
            <img src="img/pic4.png" alt="">
            <div class="txt">
                <p class="num">${data.cities} <span>个</span></p>
                <p class="tit">服务城市数</p>
            </div>
        </div>
    `)
}
